﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EzDesk.DevHelper.EzMLGenerator.EzMLanguageBuilder
{
    class EzMLLanguageBuilder
    {
        private string textSource;

        List<EzMLProcessor> processors = new List<EzMLProcessor>();

        public EzMLLanguageBuilder(string textSource, string sectionName)
        {
            this.textSource = textSource;

            processors.Add(new LanguageReplaceTextProcessor());
            processors.Add(new LanguageUserInfoProcessor());
            processors.Add(new LanguageImptProcessor());
            processors.Add(new LanguageLinkProcessor());
            processors.Add(new LanguageNewLineProcessor());
            processors.Add(new LanguageBasicInfoProcessor(sectionName));
            processors.Add(new LanguageReplacementProcessor());
            processors.Add(new LanguageStrongProcessor());
            processors.Add(new LanguagWeakProcessor());
            
        }

        public string Build()
        {
            string source = textSource;
            foreach (var processor in processors)
            {
                source = processor.Process(source);
            }
            return source;
        }
    }
}

